package com.liuzhilin.util;

import org.mindrot.jbcrypt.BCrypt;
/*
* 对数据库中密码的加密解密
* */
public class BCryptService {

    //加密
    public static String encryptPassword(String password) {
        return BCrypt.hashpw(password, BCrypt.gensalt());
    }
    //验证
    public static boolean checkPassword(String Password, String hashedPassword) {
        return BCrypt.checkpw(Password, hashedPassword);
    }

}
